<?php
/**
 *  NevuxBB - Free Forum Software
 *  Copyright (C) 2008, 2010 NevuxBB (No one specific author)*  This program is free software: you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation, either version 3 of the License, or
 *  (at your option) any later version.
 *
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
 *
 * Language Core
 * File: lang_core.php
 * Purpose: For retrieving the correct language files
 * Todo: Finish writing it
 *
 */

class LanguageCoreLite {
	private $curr_lang;
	private $common;
	private $slot;
	
	/**
	* Initialise the class
	*
	* @return void
	*/
	function __construct() {
		// set the current language
		$this->curr_lang = ForumSettings::getCurrentLanguge();
		
		// always need common language
		include(BASE_PATH . '/system/lang/' . $this->curr_lang . '/common.php');
		$this->common = $lang;
		
		unset($lang);
	}
	
	/**
	* Add a file to the slot
	*
	* @access public
	* @return void
	*/
	public function add_file($file) {
		// add more language variables
		@include(BASE_PATH . '/system/lang/' . $this->curr_lang . '/' . $file . '.php');
		$this->slot = $lang;
		
		// cleanup
		unset($lang);
	}
	
	public function reset() {
		// reset the slot
		$this->slot = NULL;
	}
	
	
	public function get_var($name, $slot) {
		switch ($slot) {
		case 1:
			// 1 is for common
			return $this->common[$name];
			break;
		case 3:
			// 3 is for slot
			return $this->slot[$name];
			break;
		}
	}

}
?>